package com.htl.exampro.course.pojo.domain;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 课程表
 * </p>
 *
 * @author hehehe
 * @since 2025-07-07
 */
@Data
@TableName("course")
@Schema(name = "CourseDO", description = "课程表")
public class CourseDO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;
    public static final String COURSE_ID = "course_id";
    public static final String COURSE_CODE = "course_code";
    public static final String COURSE_NAME = "course_name";
    public static final String TEACHERNAME = "teacherName";
    public static final String DESCRIPTION = "description";
    public static final String DURATION = "duration";
    public static final String START_TIME = "start_time";
    public static final String MAX_STUDENTS = "max_students";
    public static final String COVER = "cover";
    public static final String LEVEL = "level";
    public static final String SUBJECT = "subject";
    public static final String RATING = "rating";
    public static final String RATING_COUNT = "rating_count";
    public static final String STUDENT_COUNT = "student_count";
    public static final String STATUS = "status";
    public static final String IS_PUBLIC = "is_public";
    public static final String CREATED_PERSON = "created_person";
    public static final String CREATED_TIME = "created_time";
    public static final String UPDATED_PERSON = "updated_person";
    public static final String UPDATED_TIME = "updated_time";
    public static final String IS_DELETED = "is_deleted";
    /**
     * 课程ID
     */
    @Schema(description = "课程ID")
    @TableId(value = "course_id", type = IdType.ASSIGN_ID)
    private Long courseId;

    /**
     * 课程代码
     */
    @TableField("course_code")
    @Schema(description = "课程代码")
    private String courseCode;

    /**
     * 课程名称
     */
    @TableField("course_name")
    @Schema(description = "课程名称")
    private String courseName;

    /**
     * 老师姓名
     */
    @TableField("teacherName")
    @Schema(description = "老师姓名")
    private String teacherName;

    /**
     * 课程说明（如：包含章节范围、题型分布等）
     */
    @TableField("description")
    @Schema(description = "课程说明（如：包含章节范围、题型分布等）")
    private String description;

    /**
     * 时长范围
     */
    @TableField("duration")
    @Schema(description = "时长范围")
    private Integer duration;

    /**
     * 开课时间
     */
    @TableField("start_time")
    @Schema(description = "开课时间")
    private LocalDateTime startTime;

    /**
     * 最大选课人数限制
     */
    @TableField("max_students")
    @Schema(description = "最大选课人数限制")
    private Integer maxStudents;

    /**
     * 课程封面
     */
    @TableField("cover")
    @Schema(description = "课程封面")
    private String cover;

    /**
     * 级别
     */
    @TableField("level")
    @Schema(description = "级别")
    private String level;
    /**
     * 学科分类
     */
    @TableField("subject")
    @Schema(description = "学科分类")
    private String subject;
    /**
     * 平均评分
     */
    @TableField("rating")
    @Schema(description = "平均评分")
    private BigDecimal rating;

    /**
     * 评分人数
     */
    @TableField("rating_count")
    @Schema(description = "评分人数")
    private Integer ratingCount;

    /**
     * 学习人数
     */
    @TableField("student_count")
    @Schema(description = "学习人数")
    private Integer studentCount;

    /**
     * 课程状态: 1-活跃 2-停用 3-归档
     */
    @TableField("status")
    @Schema(description = "课程状态: 1-活跃 2-停用 3-归档")
    private Byte status;

    /**
     * 是否公开(0私有/1公开)
     */
    @TableField("is_public")
    @Schema(description = "是否公开(0私有/1公开)")
    private Boolean isPublic;

    /**
     * 创建人ID
     */
    @TableField(value = "created_person", fill = FieldFill.INSERT)
    @Schema(description = "创建人ID")
    private String createdPerson;

    /**
     * 创建时间
     */
    @TableField("created_time")
    @Schema(description = "创建时间")
    private LocalDateTime createdTime;

    /**
     * 修改人ID
     */
    @TableField(value = "updated_person", fill = FieldFill.UPDATE)
    @Schema(description = "修改人ID")
    private String updatedPerson;

    /**
     * 修改时间
     */
    @TableField("updated_time")
    @Schema(description = "修改时间")
    private LocalDateTime updatedTime;

    /**
     * 逻辑删除标志 0-未删除 1-已删除
     */
    @TableLogic
    @TableField("is_deleted")
    @Schema(description = "逻辑删除标志 0-未删除 1-已删除")
    private Boolean isDeleted;
}
